<template>
  <el-container>
    <el-aside width="250px">
      <el-menu default-active="2" class="el-menu-vertical-demo"  background-color="#373d41" text-color="#fff" active-text-color="#ffd04b">

        <el-menu-item index="/sore">
          <i class="el-icon-menu"></i>
          <span slot="title">申请列表</span>
        </el-menu-item>
        <el-menu-item index="/addMember">
          <i class="el-icon-document"></i>
        <span slot="title">积分排行</span>
        </el-menu-item>
        <el-menu-item index="4">
          <i class="el-icon-setting"></i>
          <span slot="title">退出登录</span>
        </el-menu-item>
        
        <div class="temporaryImages">
          <img src="" alt="">
      </div>
      </el-menu>
    </el-aside>
    <el-main>
      <div class="navMenbers ">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <span class="currentLocation">当前位置：</span>
          <el-breadcrumb-item :to="{ path: '/score' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path: '/integralApplication'}">申请列表</el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path: ''}">退出登录</el-breadcrumb-item>
        </el-breadcrumb>
        </div>
        <div class="memberList ">
           <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="姓名" prop="studentName" class="formItemStyle">
            <el-input v-model="ruleForm.studentName" class="inpuStyle" ></el-input>
          </el-form-item>
           <el-form-item label="学号" prop="studentID" class="formItemStyle">
            <el-input v-model="ruleForm.studentID"  class="inpuStyle"></el-input>
          </el-form-item>
          <el-form-item label="积分" prop="Integral" class="formItemStyle">
            <el-input v-model="ruleForm.Integral" placeholder="请输入积分，例如-1，+2等"  class="inpuStyle"></el-input>
          </el-form-item>
          <el-form-item label="积分事项" prop="integralContent" class="formItemStyle">
            <el-input type="textarea" :rows="4"  v-model="ruleForm.integralContent" class="textAreaStyle"></el-input>
          </el-form-item>
          <el-form-item style="width:450px;">
              <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
              <el-button @click="resetForm('ruleForm')">重置</el-button>
            </el-form-item>
           </el-form>
          </div>
        </el-main>
      </el-container>
</template>

<script>
// import api from "@/api.js";
export default {
  data() {
    return {
      ruleForm: {
        studentName: "",
        studentID: "",
        Integral: "",
        integralContent: ""
      },
      rules: {
        studentName: [
          { required: true, message: "请输入姓名", trigger: "blur" },
          {
            min: 3,
            max: 5,
            message: "姓名长度在 3 到 5 个字符",
            trigger: "blur"
          }
        ],
        studentID: [
          { required: true, message: "请输入学号", trigger: "blur" },
          {
            min: 11,
            max: 11,
            message: "学号长度在11个字符",
            trigger: "blur"
          }
        ],
        Integral: [
          { required: true, message: "请输入申请分数", trigger: "blur" },
          {
            min: 2,
            max: 11,
            message: "分数长度在2~11个字符",
            trigger: "blur"
          }
        ],
        integralContent: [
          { required: true, message: "请输入积分事项", trigger: "blur" },
          {
            min: 11,
            max: 200,
            message: "积分长度在11~200个字符",
            trigger: "blur"
          }
        ]
      },
      tableData: [
        {
          date: "1601170104",
          name: "张伟杰",
          integral: "+15",
          class: "16软件1班"
        },
        {
          date: "1601170105",
          name: "张朝锋",
          integral: "+5",
          class: "16软件1班"
        },
        {
          date: "1601170130",
          name: "陈炜宾",
          integral: "+7",
          class: "16软件1班"
        },
        {
          date: "1601170133",
          name: "吴家明",
          integral: "-6",
          class: "16软件1班"
        },
        {
          date: "1601050807",
          name: "张景廉",
          integral: "+10",
          class: "16计应8班"
        }
      ]
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
};
</script>
<style scoped>
.currentLocation {
  float: left;
  margin-left: 3%;
}
.el-aside {
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  color: #333;
  text-align: center;
  background-color: #f8f9fa;
}

.temporaryImages {
  width: 250px;
  height: 350px;
  margin-top: 2px;
}

.temporaryImages img {
  width: 120px;
  height: 120px;
  margin-top: 80px;
}

.navMenbers {
  width: 98%;
  margin: 5px auto;
  padding: 10px 0 10px 0;
  background-color: #ffffff;
}

.memberList {
  width: 98%;
  margin: 5px auto;
  height: 500px;
  background-color: #ffffff;
}

.memberList .el-form {
  width: 50%;
  margin: 0 auto;
  padding-top: 80px;
}

.el-form .formItemStyle {
  font-weight: bold;
}

.el-form .inpuStyle {
  width: 300px;
  height: 10px;
  float: left;
}

.el-form .textAreaStyle {
  width: 310px;
  float: left;
}

.el-form .el-button {
  margin: 0px 10% 0px 0%;
}

body > .el-container {
  margin-bottom: 25px;
}
</style>